#app {
  .main-container {
    height: 100%;
    transition: margin-left 0.28s;
    // margin-left: $base-sidebar-width;
    position: relative;
  }

  .sidebarHide {
    margin-left: 0 !important;
  }

  .sidebar-container {
    -webkit-transition: width 0.28s;
    transition: width 0.28s;
    width: $base-sidebar-width !important;
    background-color: #fff !important;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    .el-menu-item,
    .el-submenu__title {
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;

      // font-family: PingFang SC;
      // font-weight: 400;
      // font-size: 14px;
      // leading-trim: NONE;
      // color: #17233d;
      // letter-spacing: 0%;
    }

    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      &:hover {
        
        color: #fff !important;
        background: #ccc !important;
      }
    }

    & .theme-dark .is-active > .el-submenu__title {
      color: $base-menu-color-active !important;
    }

    & .nest-menu .el-submenu > .el-submenu__title,
    & .el-submenu .el-menu-item {
      min-width: $base-sidebar-width !important;

      &:hover {
        background-color: rgba(0, 0, 0, 0.06) !important;
      }
    }

    & .theme-dark .nest-menu .el-submenu > .el-submenu__title,
    & .theme-dark .el-submenu .el-menu-item {
      background-color: $base-sub-menu-background !important;

      &:hover {
        background-color: $base-sub-menu-hover !important;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      // width: 54px !important;
    }

    .main-container {
      // margin-left: 54px;
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      & > .el-submenu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        & > .el-submenu__title {
          & > span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $base-sidebar-width !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform 0.28s;
      width: $base-sidebar-width !important;
    }

    // &.hideSidebar {
    //   .sidebar-container {
    //     pointer-events: none;
    //     transition-duration: 0.3s;
    //     transform: translate3d(-$base-sidebar-width, 0, 0);
    //   }
    // }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  & > .el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-submenu > .el-submenu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: rgba(0, 0, 0, 0.06) !important;
    }
  }

  // the scroll bar appears when the subMenu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}

/* 选中状态：绿色背景 + 白色文字 + 左右间距 */
.sidebar-container .el-menu-item.is-active,
.sidebar-container .el-submenu.is-active > .el-submenu__title {
  color: #fff !important;
   box-shadow: 0 6px 10px -2px rgba(65, 167, 114, 0.3) !important; /* ② 下半阴影 */
  background: #41A772 !important;
  border-radius: 4px !important;
  margin: 3px 18px !important;
  // padding: 0 12px !important;
  height: 38px !important;
  line-height: 40px !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
}

/* 文字与图标同一行、同一高度、中线对齐 */
.sidebar-container .el-menu-item,
.sidebar-container .el-submenu__title {
   margin:3px 18px !important;
  padding: 0 8px !important;
  display: flex !important;
  align-items: center !important;   // 中线对齐
  height: 38px !important;          // 与你已设的选中高度一致
  line-height: 1 !important;        // 去掉默认行高
}

/* 图标尺寸与文字同高 */
.sidebar-container .svg-icon {
  width: 14px !important;
  height: 14px !important;
  margin-right: 8px !important;
}


#app .sidebar-container .theme-dark .el-submenu .el-menu-item {
  width: auto !important;
  min-width: 0 !important;
  height: 34px !important;              /* ⬅️ 变矮 */
  line-height: 34px !important;         /* ⬅️ 单行居中 */
  display: flex !important;
  align-items: center !important;       /* ⬅️ 上下居中 */
  margin: 0 32px !important;            /* 左右留空 */
  padding: 0 12px !important;
  border-radius: 4px !important;
}

/* 选中项绿底白字 */
#app .sidebar-container .theme-dark .el-submenu .el-menu-item.is-active {
  background-color: #41A772 !important;
     box-shadow: 0 6px 10px -2px rgba(65, 167, 114, 0.3) !important; /* ② 下半阴影 */
  color: #fff !important;
}

/* 给二级菜单底部留 8px 呼吸空间，最后一个绿块不再被截断 */
#app .sidebar-container .theme-dark .el-submenu > .el-menu {
  padding: 4px 0 12px 0 !important;   /* 上 4px 下 8px */
  margin-bottom: 0 !important;
  box-sizing: content-box !important;

   align-items: flex-start !important;   /* 不让拉伸 */
  // padding: 4px 0 !important;            /* 上下整体留一点呼吸 */
}